﻿using ERP.EntityFrameworkCore;
using ERP.Team.RBAC;
using ERP.Team.RBAC.xzc;
using ERP.xzc.User;
using ERP.xzc.User.Dto;
using Microsoft.AspNetCore.Mvc;
using System.Collections.Generic;
using System.Threading.Tasks;

namespace ERP.Web.Controllers.RBAC.xzc
{
    public class UserController : Controller
    {
        private readonly IUserService _userservice;

        public UserController(IUserService userservice)
        {
            _userservice = userservice;
        }

        public IActionResult UserPage()
        {
            return View();
        }
        [HttpPost]
        public async Task<int> AddUser(UserDto userdto)
        {
            var i =await _userservice.AddUser(userdto);
            return i;
        }
        public IActionResult UserQuery()
        {
            return View();
        }
        [HttpGet]
        public async Task<List<UserModel>> ShowUser()
        {
            return await _userservice.ShowUser();
        }
        /// <summary>
        /// 删除用户
        /// </summary>
        /// <param name="userdto"></param>
        /// <returns></returns>
        
        public async Task<int> DeleteUser(int id)
        {

        }
    }
}
